package com.example.test2;

import org.springframework.boot.CommandLineRunner;
import org.springframework.core.env.Environment;

import java.util.Objects;

@SuppressWarnings("unused")
public class MyCommandLineRunner implements CommandLineRunner {
    Environment en;
    public MyCommandLineRunner(Environment en){
        this.en = en;
    }

    @Override
    public void run(String... args) throws Exception {
        System.out.println("The Runner start to initialize ...");
        System.out.println("字符串：" + Objects.requireNonNull(en.getProperty("random.")));
    }
}
